package dawnland03.model.item;

import dawnland03.model.utility.Utility;
import dawnland03.model.entity.Entity;

import java.util.Set;
import java.util.LinkedHashSet;

/**
 * User: Petru Obreja (obrejap@yahoo.com)
 * Date: Jan 23, 2010
 * Time: 11:02:51 PM
 */
public class ItemFactory {
    private final static Set<Item> items;

    static {
        items = new LinkedHashSet<Item>();
    }

    public static Item createItem(ItemType itemType, Entity owner) {
        Integer id = Utility.getNextUuid();
        Item item = new Item(id, itemType, owner.getId());
        items.add(item);
        owner.putItemType(itemType, 1);
        return item;
    }
}
